<!doctype html>
<html>
<head>
<script>
// Attempting to access an element too early will have unexpected results.
var title = document.getElementById( "hello-world" );
console.log( title );	// null
</script>
</head>
<body>
<h1 id="hello-world">Hello World</h1>
</body>
</html>